#define _CRT_SECURE_NO_WARNINGS

#include "Heap.h"

void TestHeap()
{
    Heap hp;
    int arr[] = { 15, 18, 19, 25, 28 ,34, 65, 49, 27, 37 };
    HeapInit(&hp);

    for (int i = 0; i < sizeof(arr) / sizeof(int); i++)
        HeapPush(&hp, arr[i]);


    HeapPrint(&hp);

    HeapSort(hp.array, hp.size);

    HeapPop(&hp);

    HeapSort(hp.array, hp.size);

    HeapDestory(&hp);
}

void TestTopK()
{
    Heap hp;
    int arr[] = { 15, 18, 19, 25, 28 ,34, 65, 49, 27, 37 };
    HeapInit(&hp);

    for (int i = 0; i < sizeof(arr) / sizeof(int); i++)
        HeapPush(&hp, arr[i]);

    HeapPrint(&hp);

    PrintTopK(hp.array, hp.size, 4);
}

int main()
{
    TestHeap();
    TestTopK();
    return 0;
}